home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / dbwrendr.zip / RAY.DOC < prev    next >
Text File  |  1989-11-08  |  53KB  |  1,207 lines

  1.  
  2. ********************************************************************
  3. *                                                                  *
  4. *            Copyright (c) 1987, William T. Baldridge              *
  5. *                      All Rights Reserved                         *
  6. *                                                                  *
  7. * This file is part of DBW_Render                                  *
  8. *                                                                  *
  9. * DBW_Render is distributed in the hope that it will be useful,    *
  10. * but WITHOUT ANY WARRANTY. No author or distributor accepts       *
  11. * responsibility to anyone for the consequences of using it or for *
  12. * whether it serves any particular purpose or works at all, unless *
  13. * he says so in writing. Refer to the DBW_Render General Public    *
  14. * License for full details.                                        *
  15. *                                                                  *
  16. * Everyone is granted permission to copy, modify and redistribute  *
  17. * DBW_Render, but only under the conditions described in the       *
  18. * DBW_Render General Public License. A copy of this license is     *
  19. * supposed to have been given to you along with DBW_Render so you  *
  20. * can know your rights and responsibilities. It should be in a     *
  21. * file named COPYING. Among other things, the copyright notice and *
  22. * this notice must be preserved on all copies.                     *
  23. ********************************************************************
  24. *                                                                  *
  25. * This is the IBM-PC/XT/AT version of the DBW_Render documentation *
  26. * amended 10/31/89 by John H. Lowery                               *
  27. *                                                                  *
  28. ********************************************************************
  29.  
  30.  
  31.  
  32.  Sections
  33.  ~~~~~~~~
  34.     Announcement         - announcement of software availability
  35.     Included             - what's in the package
  36.     Under Development    - what's currently being written
  37.     Background Info      - what is this package?
  38.     Running RAY          - how to run the ray tracer
  39.     Running DISPLAY      - how to run the display program
  40.     Creating a .DAT file - what goes into the input file 
  41.     Source file info     - how to rebuild the package
  42.  
  43.  
  44.  Announcement
  45.  ~~~~~~~~~~~~
  46. If you liked the ray traced images previously distributed... you're 
  47. going to LOVE DBW_Render. This package is a FULL re-implementation 
  48. of the Ray Tracer that I've been using on VAXen to create all those 
  49. images.
  50.  
  51. It was developed to run on a standard Amiga, and will run on an IBM 
  52. (or compatible) PC, XT, AT or PS2 with 512k of memory, and a MCGA or 
  53. VGA display adapter (or compatible).  It will run (after a fashion) 
  54. without a math coprocessor, but performance is vastly improved with an
  55. 8087 or 80287.  By adding AI-heuristics, elapsed time to compute an 
  56. image is within the same order of magnitude as a VAX-780.  For example,
  57. "glass" computes (at 320x200 resolution, 256 colors) in 12 hours on a 
  58. 10 MHz AT compatible with an 80287. 
  59.  
  60.  
  61.  
  62.                                     -1-
  63.  
  64.  Included:
  65.  ~~~~~~~~~~~~
  66.      READ.ME     - Notes, latest changes, etc.
  67.      RAY.EXE     - ray tracing program
  68.      DISPLAY.EXE - general display program for RAY's output
  69.      *.DAT       - sample input files
  70.      *.TMP       - sample RAY output files
  71.      *.c         - all Microsoft C v5.1 sources for the package
  72.      *.h         - all Microsoft C include files for the package
  73.      RAY.DOC     - full documentation for the package
  74.      COPYING     - General License Agreement
  75.  
  76. Please read the General License Agreement (file: COPYING) before 
  77. proceeding.
  78.  
  79.  
  80.  Background Information
  81.  ~~~~~~~~~~~~~~~~~~~~~~
  82. The DBW_Render package uses an algorithm called Distributed Ray 
  83. Tracing.  In addition to neatly solving the hidden surface problem, 
  84. ray tracing (in general) affords the opportunity for doing excellent 
  85. (that is, highly realistic) shading and illumination calculations.
  86.  
  87. DBW_Render was originally written for the Amiga computer, but is now
  88. available for IBM-PC and PS/2 compatibles.  It is written in Microsoft 
  89. C (version 5.1) and runs on any IBM PC/XT/AT/PS2 system that is 
  90. equipped with an MCGA- or VGA-type display.  The IBM version of 
  91. DBW_Render is input-file compatible with the Amiga version (output 
  92. files are not compatible).
  93.  
  94. The RAY program knows how to create images composed of four primitive 
  95. geometric objects: spheres, parallelograms, triangles, and flat 
  96. circular rings (disks with holes in them). Some of the features of 
  97. the program are:
  98.  
  99.      Determination of correct shadows cast by arbitrarily shaped 
  100.      objects, onto arbitrarily shaped objects, due to arbitrarily 
  101.      placed light sources.
  102.  
  103.      Diffuse and specular reflections (with arbitrary levels of 
  104.      gloss or polish).  Rudimentary modeling of object-to-object 
  105.      diffusely reflected light is also implemented, that among other 
  106.      things accurately simulates color bleed effects from adjacent 
  107.      contrasting colored objects.
  108.  
  109.      Mirror reflections, including varying levels of mirror 
  110.      smoothness or perfection.
  111.  
  112.      Refraction and translucency (which is akin to variable 
  113.      microscopic smoothness, like the surface of etched glass).
  114.  
  115.      Two types of light sources: purely directional (parallel rays 
  116.      from infinity) of constant intensity, and spherical sources 
  117.      (like light bulbs, which cast penumbral shadows as a function 
  118.      of radius and distance) where intensity is determined by the 
  119.      inverse square law.
  120.  
  121.      Photographic depth-of-field.  That is, the virtual camera may 
  122.      be focused on a particular object in the scene, and the virtual 
  123.      camera's aperture can be manipulated to affect the sharpness of 
  124.      foreground and background objects.
  125.  
  126.                                     -2-
  127.  
  128.  
  129.  
  130.      Solid texturing.  Normally, a particular object (say a sphere) 
  131.      is considered to have constant properties (like color) over the 
  132.      entire surface of the object, often resulting in fake looking 
  133.      objects.  Solid texturing is a way to algorithmically change 
  134.      the surface  properties of an object (thus the entire surface 
  135.      area is no longer of constant nature) to try and model some 
  136.      real world material.  Currently the program has built in rules 
  137.      for modelling wood, marble, bricks, snow covered scenes, water 
  138.      (with arbitrary wave sources), plus more abstract things like 
  139.      color blend functions.
  140.  
  141.      Fractals.  The program implements what's known as recursive 
  142.      triangle subdivision, which creates all manners of natural 
  143.      looking surface shapes (like broken rock, mountains, etc.).  
  144.      The character of the fractal surface (degree of detail, 
  145.      roughness, etc.) is controlled by parameters fed to the 
  146.      program.
  147.  
  148.      AI heuristics to complete computation of a scene within a user 
  149.      specified length of time.
  150.  
  151. When the RAY program runs, it reads a sort of command file, that 
  152. contains a geometric description of the scene to be rendered, plus 
  153. desired global lighting conditions, camera parameters, etc.  Then 
  154. the program computes for a long time, writing each scan line to disk 
  155. as it computes it. The format of a scanline (in the .TMP) file is:
  156.  
  157.      <line  number> -   2 bytes long
  158.      <red   pixels> - 160 bytes long (4 bits per pixel)
  159.      <green pixels> - 160 bytes long
  160.      <blue  pixels> - 160 bytes long
  161.  
  162. which allows a single pixel's color to be represented in 12 bits, or
  163. 4096 colors.  For an entire screen (200 scan lines) this file is 
  164. 96,400 bytes.  A second program is run (DISPLAY.EXE) to display the 
  165. .TMP file, and optionally convert it to a standard Compuserve GIF (TM)
  166. format file.
  167.  
  168. In all, the DBW_Render package represents about 4000 lines of C 
  169. code.  It is largely based on original algorithms for the VAX by Tom 
  170. Dahl and Tone Engel at Digital Equipment Corporation. The AMIGA 
  171. version took several months to create.
  172.  
  173.  
  174.  Running R